project(make-includable)
message(STATUS "[${PROJECT_NAME}]")

function(make_includable input_file output_file)
    file(READ ${input_file} content)
    set(delim "for_c++_include")
    set(content "R\"${delim}(\n${content})${delim}\"")
    file(WRITE ${output_file} "${content}")
    # string(ASCII 27 Esc)
    # set(R "${Esc}")   #红色
    # message("${R}build ${output_file}")
    message(STATUS "build ${output_file}")
endfunction(make_includable)

# test code
# make_includable("CMakeLists.txt" "includable/CMakeLists.inc")

add_executable(make-includable make-includable.cpp)